package svgedit.TestSVG;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import org.junit.Test;
import svgedit.gui.Frame;
import svgedit.svg.SVGDocument;
import svgedit.svg.SVGElement;
import svgedit.svg.SVGGroup;
import svgedit.svg.SVGLineElement;

/**
 * test SVGGroup class
 */

public class SVGGroupTest
{
    
    /**
     * test getChildren() method
     */
    @Test
    public void testgetChildren()
    {
        Frame frame = new Frame();
        SVGDocument document;
        document = frame.getDocument();
        ArrayList<SVGElement> children = new ArrayList<SVGElement>();
        SVGGroup group = new SVGGroup(document);
        assertNotNull(group.getChildren());
        assertFalse(children.toArray(new SVGElement[0]) == group.getChildren());
        SVGLineElement child = new SVGLineElement(document);
        group.appendChild(child);
        children.add(child);
        assertNotNull(group.getChildren());
        assertFalse(children.toArray(new SVGElement[0]) == group.getChildren());
        
    }
    
    /**
     * test testcreateShape() method
     */
    @Test
    public void testcreateShape()
    {
        Frame frame = new Frame();
        SVGDocument document;
        document = frame.getDocument();
        SVGGroup group = new SVGGroup(document);
        assertTrue(group.createShape() == null);
    }
}
